home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / comm2 / ucall19.lha / ucall / Source / ucall.h < prev    next >
C/C++ Source or Header  |  1995-08-25  |  6KB  |  226 lines

  1. /* zcall.h */
  2.  
  3. #include <stdio.h>
  4. #include <string.h>
  5. #include <exec/types.h>
  6. #include <exec/errors.h>
  7. #include <libraries/locale.h>
  8. #include <devices/serial.h>
  9. #include <dos/dos.h>
  10. #include <dos.h>
  11. #include <proto/dos.h>
  12. #include <proto/exec.h>
  13. #include <proto/timer.h>
  14. #include <proto/utility.h>
  15. #include <proto/locale.h>
  16. #include <pragmas/dos_pragmas.h>
  17. #include <pragmas/exec_pragmas.h>
  18. #include <pragmas/utility_pragmas.h>
  19. #include <pragmas/timer_pragmas.h>
  20. #include <pragmas/locale_pragmas.h>
  21. #include <clib/alib_protos.h>
  22.  
  23. #define GETSTR(strnum) ((cat) ? GetCatalogStr(cat,strnum,uc_strings[strnum]) : uc_strings[strnum])
  24. #define BUFFER_SIZE         512
  25. #define BUFFER_SIZE_S       64
  26. #define BUFFER_SIZE_SCR     64
  27. #define BUFFER_SIZE_PATTERN 64
  28. #define MAX_BREAKCHARS  16
  29.  
  30. #define ZC_VERSION "$VER: UCall V 1.9 (" __DATE__ " " __TIME__ ")"
  31. #define UCALL_CONFIG "ucall-config"
  32. #define BREAK_TIME    500000
  33. #define ADDITIONAL_FLAGS 0
  34.  
  35. #define RETURN_ABBRUCH 10
  36. #define CLEANUP_RESTART -1
  37.  
  38. #define P_NOVALID    0
  39. #define P_DEVICE     1
  40. #define P_UNIT       2
  41. #define P_BAUD       3
  42. #define P_INIT       4
  43. #define P_BUSY       5
  44. #define P_NOCARRIER  6
  45. #define P_NODIALTONE 7
  46. #define P_DELAYED    8
  47. #define P_ERROR      9
  48. #define P_CONNECT    10
  49. #define P_XPRLIB     11
  50. #define P_XPROPT     12
  51. #define P_DATABITS   13
  52. #define P_PARITY     14
  53. #define P_STOPBITS   15
  54. #define P_RTS        16
  55. #define P_XON        17
  56. #define P_BUFFER     18
  57. #define P_OK         19
  58.  
  59.  
  60. #define C_CRLF       1
  61. #define C_WCONNECT   2
  62. #define C_MSG        3
  63. #define C_WAIT       4  
  64. #define C_SEND       5      
  65. #define C_COMMENT    6
  66. #define C_SENDFILE   7
  67. #define C_GETFILE    8
  68. #define C_SHLOG      9
  69. #define C_TIMEOUT   10
  70. #define C_REPEAT    11
  71. #define C_SYSTEM    12
  72. #define C_WORKDIR   13
  73. #define C_GOTO      14
  74. #define C_LABEL     15
  75. #define C_IF        16
  76. #define C_END       17
  77. #define C_GOSUB     18
  78. #define C_RETURN    19
  79. #define C_TIMELABEL 20
  80. #define C_SETFLAG   21
  81. #define C_CLEARFLAG 22
  82. #define C_IFFLAG    23
  83. #define C_PROTOCOL  24
  84. #define C_PROTMSG   25
  85. #define C_SET       26
  86. #define C_RESETLINE 27
  87. #define C_LBSIZE    28
  88. #define C_DELAY     29
  89. #define C_SETENV    30
  90. #define C_GETENV    31
  91. #define C_IFVAR     32
  92. #define C_TEXTFILE  33
  93.  
  94. #define V_OK         1
  95. #define V_ERROR      2
  96. #define V_CONNECT    3
  97. #define V_NOCARRIER  4
  98. #define V_NODIALTONE 5
  99. #define V_DEVICE     6
  100. #define V_DELAYED    7
  101. #define V_XPRLIB     8
  102. #define V_XPROPTS    9
  103. #define V_BUSY      10
  104. #define V_BUFFER    11
  105. #define V_BAUD      12
  106. #define V_UNIT      13
  107. #define V_DATABITS  14
  108. #define V_STOPBITS  15
  109. #define V_PARITY    16
  110. #define V_LINE      17
  111. #define V_DATE      18
  112. #define V_CONFIG    19
  113. #define V_SCRIPT    20
  114. #define V_FILEINFO  21
  115. #define V_TIME      22
  116. #define V_HANDSHAKE 23
  117. #define V_FILENAME  24
  118. #define V_FILESIZE  25
  119. #define V_LBSIZE    26
  120.  
  121. #define FLAG_UPLOAD     0
  122. #define FLAG_DOWNLOAD   1
  123. #define FLAG_TIMEOUT    2
  124.  
  125. #define LABEL_STRING "LABEL"
  126. #define LABELINTRO  "!##"
  127.  
  128. /****************************************************************/
  129. /*                                                              */
  130. /*  Metaxpr-Kruscht .....Tnx to Snoopy ;)                       */
  131. /*                                                              */
  132. /****************************************************************/
  133.  
  134. long  TransferSetupShared(struct IOExtSer *read, struct IOExtSer *write,UBYTE *lib);
  135. long  ReceiveFile(UBYTE *name, long wd, struct Screen *screen);
  136. long  SendFile(UBYTE *name, long wd, struct Screen *screen);
  137. long  SetOptions(UBYTE *opts);
  138.  
  139. #pragma libcall metaxprbase TransferSetupShared 3c a9803
  140. #pragma libcall metaxprbase SetOptions          36 801
  141. #pragma libcall metaxprbase SendFile            2a 90803
  142. #pragma libcall metaxprbase ReceiveFile         24 90803
  143.  
  144.  
  145. struct params
  146.        {
  147.         UBYTE *text;
  148.         ULONG  n;
  149.        };
  150.  
  151. struct c_node
  152.        {
  153.         struct Node   node;
  154.         UBYTE         cmd[BUFFER_SIZE_S];
  155.         UBYTE         sub[BUFFER_SIZE_S];
  156.        };
  157.        
  158. struct r_node
  159.        {
  160.         struct Node    node;
  161.         struct Node    *ziel;
  162.        };
  163.  
  164. struct var_node
  165.        {
  166.         struct Node    node;
  167.         UBYTE         *text;
  168.        };
  169.                      
  170. struct user_param
  171.        {
  172.         UBYTE cfgfile   [BUFFER_SIZE];
  173.         UBYTE script    [BUFFER_SIZE];
  174.         UBYTE connect   [BUFFER_SIZE_S];
  175.         UBYTE device    [BUFFER_SIZE_S];
  176.         UBYTE nocarrier [BUFFER_SIZE_S];
  177.         UBYTE busy      [BUFFER_SIZE_S];
  178.         UBYTE nodialtone[BUFFER_SIZE_S];
  179.         UBYTE delayed   [BUFFER_SIZE_S];
  180.         UBYTE error     [BUFFER_SIZE_S];
  181.         UBYTE ok        [BUFFER_SIZE_S];
  182.         UBYTE xprlib    [BUFFER_SIZE_S];
  183.         UBYTE xpropt    [BUFFER_SIZE_S];
  184.         UBYTE data;
  185.         UBYTE parity;
  186.         UBYTE stop;
  187.         UBYTE handshake;
  188.         ULONG unit;
  189.         ULONG baud; 
  190.         ULONG bufsize;
  191.         ULONG lbsize;
  192.        };
  193.        
  194. void __stdargs main(int argc, char *argv[]);
  195. int __regargs IsZcConf(UBYTE *buffer);
  196. int ser_setup(void);
  197. void __regargs ser_cleanup(ULONG rc);
  198. int __regargs SerRead(struct IOExtSer *ioreq, BYTE *data, ULONG length);
  199. int __regargs SerWrite(struct IOExtSer *ioreq, BYTE *data, ULONG length);
  200. int makecall(void);
  201. UBYTE __regargs *skipeol(UBYTE *buffer);
  202. int opentimerdevice(void);
  203. void closetimerdevice(void);
  204. int __regargs readconfig(UBYTE *filename);
  205. ULONG __regargs checkline(UBYTE *buffer);
  206. void __regargs parseline(UBYTE *buffer,ULONG what);
  207. int  __regargs IsZcConf(UBYTE *buffer);
  208. int __regargs read_line(UBYTE *buffer,UBYTE *chrs,UBYTE n);
  209. int __regargs readscript(UBYTE *filename);
  210. void __regargs parsecomm(UBYTE *cmd);
  211. void __regargs waitstring(UBYTE *string);
  212. void __regargs makestring(UBYTE *dest,UBYTE *source);
  213. void __regargs timeout_start(ULONG sec);
  214. void timeout_end(void);
  215. void __regargs timerdelay(ULONG sec);
  216. void var_x(UBYTE **dest,UBYTE **source,ULONG what);
  217. void freebuffers(void);
  218. int getbuffers(void);
  219. void multiple_if(UBYTE *line);
  220. int check_sigs(ULONG signals);
  221. void getlocale(void);
  222. void releaselocale(void);
  223. void __asm __saveds locale_date_func(register __a1 UBYTE chr);
  224. void maketime(UBYTE *to);
  225.  
  226.